﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LeanEngine.Data.Linq.Language
{
    public sealed class FieldCompareToken : IQueryToken
    {
        #region PropertyInfo Members

        public string FieldName { get; set; }
        public string ComparedFieldName { get; set; }
        public TableToken Table { get; set; }
        public TableToken ComparedTable { get; set; }
        public string Operator { get; set; }
        public string CombineOperator { get; set; }

        #endregion

        #region CompareToken Members

        public string GetStatement()
        {
            return this.Table.Alias + "." + this.FieldName + " " + this.Operator + " " + this.ComparedTable.Alias + "." + this.ComparedFieldName + " " + CombineOperator;
        }

        #endregion
    }
}
